//
//  UIView+Extension.m
//  Safflower
//
//  Created by 袁亮 on 2016/11/30.
//  Copyright © 2016年 Migic_Z. All rights reserved.
//

#import "UIView+Extension.h"

@implementation UIView (Extension)

+(CGSize)autoFitWithText:(NSString *)text withFont:(UIFont *)font
{
    CGSize size = [text boundingRectWithSize:CGSizeMake(SCREEN_WIDTH, CGFLOAT_MAX) options:NSStringDrawingTruncatesLastVisibleLine| NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName:font} context:nil].size;
    
    return size;
}


@end
